import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public abstract class Entity {
	private int x;
	private int y;
	
	private int stepX;
	private int stepY;
	
	protected BufferedImage image = null;
	
	public Entity(String imagePath) {
		reloadImage(imagePath);
	}
	
	public void setStepX(int x) {
		stepX = x;
	}
	
	public int getStepX() {
		return stepX;
	}
	
	public void setStepY(int y) {
		stepY = y;
	}
	
	public int getStepY() {
		return stepY; 
	}
	
	public void setX(int x) {
		this.x = x;
	}
	
	public int getX() {
		return x; 
	}
	
	public void setY(int y) {
		this.y = y;
	}
	
	public int getY() {
		return y; 
	}
	
	protected void reloadImage(String imagePath){
		try {
			if (imagePath != null) {
				image = ImageIO.read(new File(imagePath));
			}
		} catch (IOException e) {
			// TODO: handle exception
		}
	}
	public void draw(Graphics2D g2d) {
		if (image != null) {
			g2d.drawImage(image, getX(), getY(), getEntityWidth(), getEntityHeight(), null);
		}
	}
	
	public static int getEntityHeight() {
		return 50;
	}
	
	public static int getEntityWidth() {
		return 60;
	}
	
	public abstract void step();
}
